#!/usr/local/bin/perl# convert data in old NACA format#          Clark YH#          0 0 0#          0.0125 0.0409 -0.0183#          0.025 .0529 -.0271#          ...#          1.0 0 0# to the new (Soartech 8) format.#	      SD-8020#          1.0 0#          0.9 0.011#          0.85 0.02#          ...#          1.0 0#$tmpfile = "tmp-nacafix-$$";foreach $filename (@ARGV) {	next if(! -f $filename);	open(INFILE, $filename);	open(OUTFILE, ">$tmpfile");	print OUTFILE scalar <INFILE>;	$i = 0;	while(<INFILE>) {		($x, $lower, $upper) = split(' ');		$upper{$i} = $x . " " . $upper . "\n";		$lower{$i} = $x . " " . $lower . "\n";		$i++;	}	$n = $i;	$_ = "";	for(; $i >= 0; $i--) {		print OUTFILE  $upper{$i};	}	$i = 0;	$i++ if($upper{$i} eq $lower{$i});	for(; $i < $n; $i++) {		print OUTFILE $lower{$i};	}	close(INFILE); close(OUTFILE);	rename($filename, $filename . ".bak");	rename($tmpfile, $filename);}